return {
    {
        "mhartington/formatter.nvim",
        config = function()
            local util = require("formatter.util")

            local clang_format_option = [[
Language                                       : Cpp,
BasedOnStyle                                   : Google,
AlignArrayOfStructures                         : Left,
AccessModifierOffset                           : -4,
AlignConsecutiveAssignments                    : true,
AlignConsecutiveBitFields                      : Consecutive,
AlignConsecutiveDeclarations                   : Consecutive,
AlignConsecutiveMacros                         : Consecutive,
AlignEscapedNewlines                           : Left,
AllowAllArgumentsOnNextLine                    : true,
AllowShortBlocksOnASingleLine                  : false,
AllowShortCaseLabelsOnASingleLine              : false,
AllowShortEnumsOnASingleLine                   : false,
AllowShortFunctionsOnASingleLine               : None,
AllowShortIfStatementsOnASingleLine            : false,
AllowShortLambdasOnASingleLine                 : Empty,
AllowShortLoopsOnASingleLine                   : false,
AlwaysBreakTemplateDeclarations                : true,
BreakBeforeBraces: Custom,
BraceWrapping: {
    AfterCaseLabel:  true,
    AfterClass:      true,
    AfterControlStatement: Always,
    AfterEnum:       true,
    AfterFunction:   true,
    AfterNamespace:  true,
    AfterObjCDeclaration: true,
    AfterStruct:     true,
    AfterUnion:      true,
    AfterExternBlock: true,
    BeforeCatch:     true,
    BeforeElse:      true,
    BeforeLambdaBody: false,
    BeforeWhile:     false,
    IndentBraces:    false,
    SplitEmptyFunction: true,
    SplitEmptyRecord: true,
    SplitEmptyNamespace: true,
},
BreakBeforeInheritanceComma                    : false,
BreakConstructorInitializers                   : AfterColon,
BreakConstructorInitializersBeforeComma        : false,
BreakInheritanceList                           : AfterColon,
LambdaBodyIndentation                          : OuterScope,
ColumnLimit                                    : 0,
ConstructorInitializerAllOnOneLineOrOnePerLine : true,
ConstructorInitializerIndentWidth              : 4,
IndentWidth                                    : 4,
PackConstructorInitializers                    : Never,
MaxEmptyLinesToKeep                            : 1,
SortIncludes                                   : false,
SpaceBeforeCtorInitializerColon                : true,
SpaceBeforeParens                              : Never,
Standard                                       : C++11,
UseTab                                         : Never
]]

            clang_format_option = string.gsub(clang_format_option, "\n", " ")
            clang_format_option = '--style="{' .. clang_format_option .. '}"'

            require("formatter").setup({
                logging = true,
                log_level = vim.log.levels.WARN,
                filetype = {
                    c = {
                        function()
                            return {
                                exe = "clang-format",
                                args = {
                                    clang_format_option,
                                    "--assume-filename=" .. vim.api.nvim_buf_get_name(0),
                                    -- '--style="{BasedOnStyle: chromium, IndentWidth: 4}"',
                                },
                                stdin = true,
                                cwd = vim.fn.expand("%:p:h"),
                            }
                        end,
                    },
                    cpp = {
                        function()
                            return {
                                exe = "clang-format",
                                args = {
                                    clang_format_option,
                                    "--assume-filename=" .. vim.api.nvim_buf_get_name(0),
                                    -- '--style="{BasedOnStyle: chromium, IndentWidth: 4}"',
                                },
                                stdin = true,
                                cwd = vim.fn.expand("%:p:h"),
                            }
                        end,
                    },
                    lua = {
                        function()
                            return {
                                exe = vim.fn.stdpath("data") .. "/mason/bin/stylua",
                                args = {
                                    "--search-parent-directories",
                                    "--indent-type Spaces",
                                    "--stdin-filepath",
                                    util.escape_path(util.get_current_buffer_file_path()),
                                    "--",
                                    "-",
                                },
                                stdin = true,
                            }
                        end,
                    },
                    python = {
                        function()
                            return {
                                exe = "yapf",
                                args = {
                                    '--style="{based_on_style: google, indent_width: 4, column_limit: 88}"',
                                },
                                stdin = true,
                            }
                        end,
                    },
                    cmake = {
                        -- require("formatter.filetypes.cmake"),
                        function()
                            return {
                                exe = "cmake-format",
                                args = { vim.fn.expand("%:t") },
                                stdin = true,
                            }
                        end,
                    },
                    verilog = {
                        function()
                            return {
                                exe = "verible-verilog-format",
                                args = {
                                    "--indentation_spaces 4",
                                    "--assignment_statement_alignment align",
                                    "--module_net_variable_alignment align",
                                    "--named_parameter_alignment align",
                                    "--port_declarations_alignment align",
                                    vim.fn.fnameescape(vim.api.nvim_buf_get_name(0)),
                                },
                                -- args = { "--stdin-name -" },
                                stdin = true,
                            }
                        end,
                    },

                    json = {
                        require("formatter.filetypes.json").jq,
                    },
                    rust = {
                        require("formatter.filetypes.rust").rustfmt,
                    },
                    zig = {
                        require("formatter.filetypes.zig").zigfmt,
                    },
                },
            })

            vim.api.nvim_create_autocmd({ "BufWritePost" }, {
                pattern = { "*.h", "*.hpp", "*.c", "*.cpp", "*.py", "*.lua", "*.json", "CMakeLists.txt", "*.rs" },
                command = "FormatWrite",
            })
        end,
    },
}
